package com.xindacloud.sms.console.system.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xindacloud.sms.console.result.Result;
import com.xindacloud.sms.console.system.dto.SmsApiDTO;
import com.xindacloud.sms.console.system.entity.SmsApi;
import com.xindacloud.sms.console.system.service.ISmsApiService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author czc
 * @since 2019-11-28
 */
@Api(tags = {"Api文档模块"})
@RestController
@RequestMapping("/api/v1/sms-api")
public class SmsApiController {
	
	@Autowired
    private ISmsApiService smsApiService;


    @ApiOperation(value = "API文档列表", response = SmsApi.class)
    @PostMapping(value = "/getSmsApiList")
    public Result getSmsApiList(@RequestBody SmsApiDTO smsApiDTO) {
        return smsApiService.getSmsApiList(smsApiDTO);
    }

    @ApiOperation(value = "修改API文档", response = SmsApi.class)
    @PutMapping("/saveOrUpdateSmsApi")
    public Result saveOrUpdateSmsApi(@RequestBody SmsApiDTO smsApiDTO) {
        return smsApiService.saveOrUpdateSmsApi(smsApiDTO);
    }	
    
    @ApiOperation(value = "删除API文档")
	@PostMapping(value = "/deleteSmsApi")
	public Result deleteSmsApi(@RequestBody  SmsApiDTO smsApiDTO) {
	    return smsApiService.deleteSmsApi(smsApiDTO);
	}
    

}
